package com.wiiss.ams.cron.task.action.collecting_handling_cron_action;


import com.wiiss.ams.cron.task.action.CronAction;
import com.wiiss.ams.cron.task.action.collecting_handling_cron_action.collector.Collector;
import com.wiiss.ams.cron.task.action.collecting_handling_cron_action.handler.Handler;

public class CollectingAndHandlingCronAction extends CronAction {

    private Collector collector;

    private Handler handler;

    public CollectingAndHandlingCronAction(String name, Collector collector, Handler handler) {
        super(name);
        this.collector = collector;
        this.handler = handler;
    }

    @Override
    public void execute() {
        note.append(handler.handle(cron, collector.collect(cron)));
    }

}
